average.js ➔ average   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
crap 2
1
import summ from './summ';
0 ignored issues
show
introduced by
Missing file extension "js" for "./summ"
Loading history...
2
3
export default function average(originalArray) {
4 4
    if (!Array.isArray(originalArray) || originalArray.length < 1) {
5 1
        return null;
6
    }
7
8 1
    return summ(originalArray) / originalArray.length;
9
}
10